package com.nf.recruitment.controller;

import com.nf.recruitment.entity.UserInfo;
import com.nf.recruitment.service.UserService;
import com.nf.recruitment.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController{
    @Autowired
    private UserService service;

    @GetMapping("/list")
    public ResultVO listDepartment(@RequestBody UserInfo userInfo) {
        UserInfo user = service.getUserById(userInfo.getUserId());
        return new ResultVO<>(200, "", user);
    }

    @PostMapping("/save")
    public ResultVO saveDegree(@RequestBody UserInfo dto) {
        service.saveUser(dto);
        return success();
    }

}
